#ifndef _CIRCLE_BUFFER_H_
#define _CIRCLE_BUFFER_H_

#include "define_comm.h"


typedef struct
{
	sj_int32 size;
	sj_int32 read;
	sj_int32 write;
	sj_int8  full;
	sj_int32 item_size;
	sj_int32 item_num;
	sj_void  *item_ptr;
}circle_buffer_info;

sj_int8 circle_buffer_create(circle_buffer_info *info,sj_int8 item_size, sj_int8 item_num);

sj_int8 circle_buffer_write(circle_buffer_info *info,sj_void  *data ,sj_int32 len);

sj_int32 circle_buffer_read(circle_buffer_info *info,sj_void  *data ,sj_int32 len);

sj_int8 circle_buffer_is_empty(circle_buffer_info *info);

sj_int32 circle_buffer_get_num(circle_buffer_info *info);

sj_int32 circle_buffer_set_read(circle_buffer_info *info,sj_int32 index);

sj_int8 circle_buffer_destory(circle_buffer_info *info);

sj_int8 circle_buffer_clear(circle_buffer_info *info);




#endif